<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        .box {
            width: 200px;
            height: 200px;
            background-color: #d61c1c;
        }
    </style>
</head>

<body>
    <div class="box"></div>
    <script>
        // 获取div的元素
        const box = document.querySelector('.box')

        // 修改样式
        box.style.width = '300px'
        // 属性样式有连接符的转换为小驼峰命名法，background-Color =》backgroundColor
        box.style.backgroundColor = 'green'
        box.style.border = '5px solid black'
        box.style.borderTop = '5px solid blue'


    </script>
</body>

</html>